﻿Imports System.Data
Imports System.Data.SqlClient
Imports Microsoft.ApplicationBlocks.Data

Namespace Analytics
    Public Class Analytic
        Inherits DataAccess
        Private _TotalArticle As String
        Private _TotalPage As String
        Private _TotalCat As String
        Private _TotalTag As String
        Private _TotalComment As String
        Private _TotalComment0 As String
        Private _TotalComment1 As String

        Public Property TotalArticle() As String
            Get
                Return _TotalArticle
            End Get
            Set(ByVal value As String)
                _TotalArticle = value
            End Set
        End Property
        Public Property TotalPage() As String
            Get
                Return _TotalPage
            End Get
            Set(ByVal value As String)
                _TotalPage = value
            End Set
        End Property
        Public Property TotalCat() As String
            Get
                Return _TotalCat
            End Get
            Set(ByVal value As String)
                _TotalCat = value
            End Set
        End Property
        Public Property TotalTag() As String
            Get
                Return _TotalTag
            End Get
            Set(ByVal value As String)
                _TotalTag = value
            End Set
        End Property
        Public Property TotalComment0() As String
            Get
                Return _TotalComment0
            End Get
            Set(ByVal value As String)
                _TotalComment0 = value
            End Set
        End Property
        Public Property TotalComment() As String
            Get
                Return _TotalComment
            End Get
            Set(ByVal value As String)
                _TotalComment = value
            End Set
        End Property
        Public Property TotalComment1() As String
            Get
                Return _TotalComment1
            End Get
            Set(ByVal value As String)
                _TotalComment1 = value
            End Set
        End Property

        Public Sub New()

        End Sub

        Public Sub GetStatus()
            Try
                Dim reader As SqlDataReader = SetStatus()
                If reader.Read() Then
                    TotalArticle = reader("TotalArticle").ToString()
                    TotalPage = reader("TotalPage").ToString()
                    TotalCat = reader("TotalCat").ToString()
                    TotalTag = reader("TotalTag").ToString()
                    TotalComment = reader("TotalComment").ToString()
                    TotalComment0 = reader("TotalComment0").ToString()
                    TotalComment1 = reader("TotalComment1").ToString()
                End If
                reader.Close()
            Catch ex As Exception
            End Try
        End Sub

        Public Function SetStatus() As SqlDataReader
            Dim param(1) As SqlClient.SqlParameter
            param(0) = New SqlClient.SqlParameter("@SiteID", SqlDbType.Int, 4)
            param(0).Value = Configs.SiteID

            Return SqlHelper.ExecuteReader(Configs.ConnectionString, CommandType.StoredProcedure, "Justin_Statitics_View", param)
        End Function
    End Class
End Namespace